/*
 *  $Id: HeavensThrone.cs 1055 2010-05-19 12:02:44Z thenn.erannor $
 *  This file is a part of Ragima CCG.
 *  (C) 2008 Ragima development group.
 *
 *  Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Light.Lands {
    public class HeavensThrone: LandCard {
        public HeavensThrone() : base("001_l_l_heavens_throne") {
            Level = CompleteLevel.ReadyForTest;
            Element = ElementType.Light;
            Value = 100;
            MaxCount = 1;
            Category = CardCategory.Ragima;
            AddManaCost(ElementType.Light, 20);
        }
        public override void SetNaturalAffects(ICollector<Affect> affects) {
            affects.Add<Affects.Antimagic>();
            affects.Add<Affects.AntimagicArea>();
            affects.Add<HeavensThroneAura>();
            affects.Add(new Affects.RagimaMana(ElementType.Light));
        }

        private class HeavensThroneAura: CreatureAuraAffect {
            public HeavensThroneAura(): base(true, false) {}

            public override string Id {
                get { return AffectManager.GetCardId<HeavensThrone>("aura"); }
            }

            protected override Affect CreateSubAffect() {
                return new HeavensThroneAffect();
            }

            public override void SetAffect() {
                base.SetAffect();
                GlobalSummary.AddVanguard(Affects.Vanguard.Always);
            }
            public override void ResetAffect() {
                base.ResetAffect();
                GlobalSummary.RemoveVanguard(Affects.Vanguard.Always);
            }
        }

        private class HeavensThroneAffect: SpellAffect<HeavensThrone> {
            public HeavensThroneAffect() {
                Add(new Affects.FirstStrike());
                Add(new Affects.Tireless());
                Add(new Affects.Reincarnation(4));
                Add(new Affects.FlightBlock());
                Add(new Affects.Inerrancy());
                Add(new Affects.Vanguard());
            }
        }
    }
}
